<template>
	<view class="h_100">
		<!-- <view class="mt-5" v-if="u_loadmore">
			<u-loadmore status="loading" icon-type="circle" />
		</view> -->
		<view class="h_100">
			<view v-if="shelveList.length<=0" class="d-flex flex-column w-100 a-center j-center h_100">
				<image src="../../static/images/home/icon_no_data.png" mode="" class="icon_no_data"></image>
				<view class="">暂无商品</view>
			</view>
			<view v-else  class="goods_card bg-white m-2 p-3 rounded-20" v-for="(item,index) in shelveList" :key="index">
				<view class="goods_card_head d-flex"  @click="goodsEdit(item)">
					<view class="goods_card_head_left position-relative ">
						<view v-if="item.has_product=='yes'" class="text-white goods_logo">多货品</view>
						<image class="img_url" :src="item.img.url?item.img.url:defaltImage" mode="aspectFit"></image>
						<view class="position-absolute top-0 left-0 z-222" v-if="item.goods_video_url">
							<image src="../../static/images/goods/video.png" mode="" class="video_img"></image>
						</view>
					</view>
					<view class="goods_card_head_right pl-3">
						<view class="d-flex">
							<view class="ellipsis pro_name">
								{{item.name}}
							</view>
						</view>
						<view class="text-light-muted font-md my pt-2">
							<text class="mr-3">库存：{{item.stock}}</text>
							<text>销量：{{item.sales_volume}}</text>
						</view>
						<view class="mt-1 pt">
							<text class="text-danger mr-2 font-35">{{item.shop_price}}</text><text class="font-md text-light-muted tex line-through">{{item.market_price}}</text>
						</view>
					</view>
				</view>
				<view class="mt-2 font d-flex j-end" >
					<view class="goods_card_content_footer" v-for="(goodsItem,goodsIndex) in items" :key="goodsIndex" @click="goodsshelve(goodsItem,item)">
						<view>{{goodsItem.title}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				defaltImage:'../../static/images/goods/icon_default_image.png',
				items:[
					{title:"智能权重",del_id:1,delShow:false},
					{title:"删除",del_id:1,delShow:false},
				],
			}
		},
		props:["shelveList"],
		methods:{
			goodsEdit(item){
				this.$emit("goodsDetail",item)
			},
			goodsshelve(goodsItem,item){
				this.$emit("goods_shelve",goodsItem,item)
			}
		}
	}
</script>

<style>
</style>
